﻿<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%@ include file="/common/meta.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>MCCMS</title>
		<script src="${ctx}/js/jquery.ui/ui/jquery.ui.all.js"
			type="text/javascript"></script>
		<script src="${ctx}/js/layout/jquery.layout.js" type="text/javascript"></script>
		<script src="${ctx}/js/ddaccordion.js" type="text/javascript"></script>
		<link href="${ctx}/js/jquery.ui/themes/default/ui.all.css"
			rel="stylesheet" type="text/css" />
		<link href="${ctx}/image/style_blue5/style.css" rel="stylesheet"
			type="text/css" />
		<script src="${ctx}/image/style_blue5/style.js" type="text/javascript"></script>
		<script src="${ctx}/js/mainframe_nav.js" type="text/javascript"></script>


<style>
.arrowlistmenu .ul_li_image li{
	background:url(${ctx}/image/style_blue5/menu_item_icon.gif) no-repeat;
	padding-left:20px;
}
</style>

<script>
	function linkTOlink(i){
		switch(i){
			case 1:
				document.getElementById("leftFrame").src="${ctx}/baseleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/defaultAction.action";
				break;
			case 2:
				document.getElementById("leftFrame").src="${ctx}/styleleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/style/webSkinAction.action";
				break;
				
			case 3:
				document.getElementById("leftFrame").src="${ctx}/columnleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/base/epColumnAction!query.action?father=0";
				break;
				
			case 4:
				document.getElementById("leftFrame").src="${ctx}/collectionleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/collection/epNewsAction!query.action?father=0";
				break;
			case 5:
				document.getElementById("leftFrame").src="${ctx}/dynamicleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/dynamic/enterpriseBulletinAction.action";
				break;
			case 6:
				document.getElementById("leftFrame").src="systemleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/usersAction.action";
				break;
			case 7:
				document.getElementById("leftFrame").src="${ctx}/chinamobileleftFrame.action";
				document.getElementById("mainFrame").src="${ctx}/chinamobile/saleorderAction.action";
				break;
			case 100://修改密码
				document.getElementById("mainFrame").src="${ctx}/basic/updatePasswordAction.action";
				break;
		}
		setCurrent(i);
	}
	$(document).ready(function(){
	
		var mainFrame = document.getElementById('mainFrame');
		var leftFrame = document.getElementById('leftFrame');
		
		mainFrame.onload = mainFrame.onreadystatechange = function() {
				var roleType = mainFrame.contentWindow.document.getElementById("roleType");
		     	if($(roleType).html()!=null){
					location='${ctx}/j_spring_security_logout';
				}
		}
		
		leftFrame.onload = leftFrame.onreadystatechange = function() {
				var roleType = leftFrame.contentWindow.document.getElementById("roleType");
		     	if($(roleType).html()!=null){
					location='${ctx}/j_spring_security_logout';
				}
				var htmlTemp = leftFrame.contentWindow.document.getElementById("collumnHtml");
				$(htmlTemp).attr("style","height:100%;");
				var bodyTemp = leftFrame.contentWindow.document.getElementById("collumnBody");
				$(bodyTemp).attr("style","position: relative; height: 100%; margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial;");
		}
		
		showtime();
	});
	
		function showtime()
		{
			var today=new Date(); 
			var year=today.getFullYear();
			var month=today.getMonth()+1;
			var day=today.getDate();
			var hours = today.getHours(); 
			var minutes = today.getMinutes(); 
			var seconds = today.getSeconds(); 
			var timeValue= hours;//((hours >12) ? hours -12 :hours);
			timeValue += ((minutes < 10) ? ":0" : ":") + minutes+""; 
			//timeValue += (hours >= 12) ? "PM" : "AM"; 
			timeValue+=((seconds < 10) ? ":0" : ":") + seconds+"";
			var timetext=year+"-"+month+"-"+day+" "+timeValue
			//document.write("<span onclick=\"document.getElementById('time').value='"+timetext+"'\">"+timetext+"</span>"); 
			document.getElementById("liveclock").innerText = timetext; //div的html是now这个字符串 
			setTimeout("showtime()",1000); //设置过1000毫秒就是1秒，调用showtime方法
		}
	
		function setCurrent(i){
			var count = 1;
			$("#all_nav ul li").each(function(){
				 $(this).removeClass("current");
				 count++;
			});
			$("#"+i).addClass("current");
		}
</script>
	</head>
	<body>
		<div id="top">
			<div>
				<div id="icon">
					<img src="${ctx}/image/style_blue5/logo.jpg" />
				</div>
				<div
					onclick="linkTOlink(100);"
					id="changePassword">
					修改密码
				</div>
				<div onclick="location='${ctx}/j_spring_security_logout'" id="logout">注销</div>
				<div onclick="javascript:window.open('${webSite.domain}','_blank')" id="home">
					查看首页
				</div>
				<div id="layout-top-close"></div>
			</div>
			<div style="clear:both;"></div>
			<div id="logout_all">
				<div id="all_now">
					现在时间:<span id="liveclock"></span>
				</div>
				<div id="all_line"></div>
				<div id="all_nav">
				<ul>
					<security:authorize ifAnyGranted="EP_BASE">
						<li id="1" class="current"><a href="javascript:linkTOlink(1);">基本配置</a></li>
					</security:authorize>
					<security:authorize ifAnyGranted="EP_SKIN">
						<li id="2"><a href="javascript:linkTOlink(2);">界面风格</a></li>
					</security:authorize>
					<security:authorize ifAnyGranted="EP_COLUMN">
						<li id="3"><a href="javascript:linkTOlink(3);">栏目配置</a></li>
					</security:authorize>
					<security:authorize ifAnyGranted="EP_COLLECTION">
						<li id="4"><a href="javascript:linkTOlink(4);">内容管理</a></li>
					</security:authorize>
					<security:authorize ifAnyGranted="EP_DYNAMIC">
						<li id="5"><a href="javascript:linkTOlink(5);">互动管理</a></li>
					</security:authorize>
					<security:authorize ifAnyGranted="EP_SYSTEM">
						<li id="6"><a href="javascript:linkTOlink(6);">用户管理</a></li>
					</security:authorize>
					<li id="7"><a href="javascript:linkTOlink(7);">业务管理</a></li>
				</ul>
				</div>
			</div>
		</div>
		<div id="menu">
			<div class="menu-title">
				你好,<font color="red">${currentUserName}</font>
			</div>

			<div class="line ui-layout-toggler"></div>

			<div id="layout-menu-close" style="text-align: center;"></div>
			
						<!-- 内容管理系统
						<div class="arrowlistmenu"> -->
				<iframe width="100%" height="100%" frameborder="0" style="overflow:scroll;background:#f4f7fb;"
					id="leftFrame" name="leftFrame" src="${ctx}/baseleftFrame.action"></iframe>
					<!---->
					<!--</div>-->
		</div>

		<div id="content">
			<div id="container">
				<div id="layout-footer-open"></div>
				<div id="layout-top-open"></div>
				<div id="layout-menu-open"></div>

				<div id="welcome">
					<iframe width="100%" height="100%" frameborder="0" id="mainFrame" name="mainFrame" scrolling="yes"
						allowtransparency="true" src="${ctx}/chinamobile/saleorderAction.action"></iframe>
				</div>
			</div>
			
			<div class="ui-layout-south"></div>
			
		</div>

		<div id="footer">
		
			<div id="layout-footer-close"></div>
			
			<div id="copyright">
				
			</div>
		</div>
		<div id ="mess" style="display:none;margin:0px; padding: 0px; border-width: 0px; border-style: initial; border-color: initial; background-image: none; position: absolute; z-index: 11000; top: 0px; left: 0px; background-color: black; opacity: 0.8; width: 1365px; height: 642px; ">
			<center>
				<div style="width:400px;margin-left:100px;color:white;background-color: grey;text-align:right;margin-top:200px;margin-left:100px;">
					<input type="button" value="关闭" onclick="javascript:$('#mess').hide();"/>
				</div>
				<div id="messageContext" style="padding:10px 0 20px 0;width:400px;height:auto;margin-left:100px;color:white;background-color: grey;text-align:left;">
				</div>
			</center>
		</div>
		
		</body>
</html>
